﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;

public partial class RecoverPassword : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
    {
        e.Message.Body = e.Message.Body.Replace("<%url%>",(Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath+ "/Login.aspx"));

        SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
        client.EnableSsl = true;
        client.Send(e.Message);
        e.Cancel = true;
    }
}
